// 云函数入口文件
const cloud = require('wx-server-sdk')
const rp = require('request-promise')
const URL = 'http://musicapi.xiecheng.live'
cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  const musicId = event.musicId
  let page = event.page
  let result = await rp(URL + `/comment/music?id=${musicId}&limit=15&offset=${page}`)
  result = JSON.parse(result)
  return result
}